﻿/*
 * 类名：SM2Util
 * 描述：
 * 创 建 者：十一 
 * 创建时间：2024/6/26 0:04:13 
 */
namespace YuanCodeStudio.Utils.SM2
{
    public class SM2Util
    {
        private static readonly string PublicKey = "0403843F404D345E141B093C0E06737ED79F87B23FCC00541B616CAADD9E6626F324C7C60F38EFF09E320E19ED0072C120D4C6BEFCF182783EB339C39DE0D1A492";

        private static readonly string PrivateKey = "00CC67DC3D30CF4D89D541F754988D432C787C8A48A2AB85F2279313A022980450";

        public static string Encrypt(string plainText)
        {
            return SM2CryptoUtil.Encrypt(PublicKey, plainText);
        }

        public static string Decrypt(string cipherText)
        {
            if (!cipherText.StartsWith("04")) cipherText = "04" + cipherText;
            return SM2CryptoUtil.Decrypt(PrivateKey, cipherText);
        }
    }
}
